package cn.larry.tools.exception;

/**
 * Larry
 * 2021/12/22 20:51
 *
 * @Version 1.0
 */
public class SysException extends Exception {

    private String sysCode;
    private String sysCodeMsg;

//    public SysException(){
//        super();
//    }

    public SysException(String sysCode) {
        this.sysCode = sysCode;
    }

    public SysException(String sysCode, String codeMsg) {
        this.sysCode = sysCode;
        this.sysCodeMsg = codeMsg;
    }

    public String getMessage() {
        if (getCause() != null)
            return getCause().getMessage();
        return this.sysCodeMsg;
    }

    public void printStackTrace() {
        if (getCause() != null)
            getCause().printStackTrace();
        else
            super.printStackTrace();
    }

    public String getSysCode() {
        return sysCode;
    }

    public void setSysCode(String sysCode) {
        this.sysCode = sysCode;
    }

    public String getSysCodeMsg() {
        return sysCodeMsg;
    }

    public void setSysCodeMsg(String sysCodeMsg) {
        this.sysCodeMsg = sysCodeMsg;
    }
}